home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / C / MFL_MS.ZIP / MFL_QREF.DOC < prev    next >
Encoding:
Text File  |  1989-11-27  |  25.3 KB  |  951 lines

  1.  
  2.              MICROFIRM FUNCTION LIBRARY QUICK REFERENCE GUIDE
  3.  
  4.             Copyright 1988-89 by Robert B. Stout dba MicroFirm
  5.  
  6.  
  7. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  8. *  MFLFILES.H                                                          *
  9. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  10.  
  11.  
  12. **********************************************************
  13. *  Check for the existance of a file                     *
  14. **********************************************************
  15.  
  16. int exists(char *);
  17. See if a file exists
  18.              
  19. **********************************************************
  20. *  Change/verify disk drives or directories              *
  21. **********************************************************
  22.  
  23. int chdrv(char);
  24. Change disk drives
  25.  
  26. LOGICAL drvalid(char);
  27. See if a drive is valid
  28.  
  29. char getdrv(void);
  30. Return default drive
  31.  
  32. int pushdir(char *);
  33. Save current directory, then go to a new one
  34.  
  35. int popdir(void);
  36. Return to previous directory
  37.  
  38. **********************************************************
  39. *  File operations using FCB functions                   *
  40. **********************************************************
  41.  
  42. int FCB_creat(char *, int);
  43. Create a file using a file control block
  44.  
  45. int FCB_kill(char *, int);
  46. Delete a file using a file control block
  47.  
  48. struct XFCB *  FCB_open(char *, int);
  49. Open a file using a file control block
  50.  
  51. int FCB_close(struct XFCB *);
  52. Close a file using a file control block
  53.  
  54. int FCB_reads(struct XFCB *, void *);
  55. Sequential read using a file control block
  56.  
  57. int FCB_writes(struct XFCB *, void *);
  58. Sequential write using a file control block
  59.  
  60. int FCB_readr(struct XFCB *, void *, long);
  61. Random read using a file control block
  62.  
  63. int FCB_writer(struct XFCB *, void *, long);
  64. Random write using a file control block
  65.  
  66. **********************************************************
  67. *  Manipulate volume labels                              *
  68. **********************************************************
  69.  
  70. char *flretvol(char);
  71. Return volume label for a specified drive
  72.  
  73. int flremvol(char);
  74. Remove volume label for a specified drive
  75.  
  76. int flsetvol(char, char *);
  77. Set volume label for a specified drive
  78.  
  79. **********************************************************
  80. *  Delete files using FCB's - very fast with wildcards!  *
  81. **********************************************************
  82.  
  83. int del_files(char *, char *);
  84. Delete all files matching a spec in a given directory
  85.  
  86. **********************************************************
  87. *  Copy files                                            *
  88. **********************************************************
  89.  
  90. int fcopy(char *, char *, int);
  91. Copy one file to another with overwrite control
  92.  
  93. **********************************************************
  94. *  Expand command line wildcard arguments                *
  95. **********************************************************
  96.  
  97. extern char **nargv;
  98. int expand_args(int, char *[]);
  99. Expand command line arguments
  100.  
  101. **********************************************************
  102. *  Directory operations using file-type functions        *
  103. **********************************************************
  104.  
  105. DOS_DIR * opendir(char *);
  106. Open a directory for reading
  107.  
  108. void closedir(DOS_DIR *);
  109. Close a directory
  110.  
  111. struct find_t * readdir(DOS_DIR *);
  112. Read directory entries
  113.  
  114. int dirmask(struct find_t *, char *, char *, unsigned, unsigned);
  115. Validates directory entries based on name and attributes
  116.  
  117. **********************************************************
  118. *  Stream functions for installable stream filters.      *
  119. **********************************************************
  120.  
  121. SFILE * sfopen(char *, char *);
  122. Open a file as a filterable stream
  123.  
  124. SFILE * scopen(int (*)(), int (*)(), char *);
  125. Open a channel as a filterable stream
  126.  
  127. int sfclose(SFILE *);
  128. Close an open stream
  129.  
  130. int sfputc(int, SFILE *);
  131. Put a character to a stream
  132.  
  133. int sfputs(char *, SFILE *);
  134. Put a string to a stream
  135.  
  136. size_t sfwrite(void *, size_t, size_t, SFILE *);
  137. Write a buffer to a stream
  138.  
  139. int sfgetc(SFILE *);
  140. Get a character from a stream
  141.  
  142. char  * sfgets(void *, int, SFILE *);
  143. Get a string from a stream
  144.  
  145. size_t sfread(void *, size_t, size_t, SFILE *);
  146. Read a buffer from a stream
  147.  
  148. LOGICAL sfinstall(SFILE *, SFILTER *);
  149. Install a stream filter
  150.  
  151. **********************************************************
  152. *  Simple stream filters                                 *
  153. **********************************************************
  154.  
  155. extern SFILTER    ucase_filt,
  156. Forces a stream to upper case
  157.  
  158. extern SFILTER    lcase_filt;
  159. Forces a stream to lower case
  160.  
  161. **********************************************************
  162. *  Stream encryption function                            *
  163. **********************************************************
  164.  
  165. int crypt_install(SFILE *, char *, int);
  166. Installs an encryption/decryption filter
  167.  
  168. **********************************************************
  169. *  Stream compression/expansion functions                *
  170. **********************************************************
  171.  
  172. int ncode_install(SFILE *);
  173. Installs an RLE encoder as a stream filter
  174.  
  175. int dcode_install(SFILE *);
  176. Installs an RLE decoder as a stream filter
  177.  
  178. **********************************************************
  179. *  File truncation functions                             *
  180. **********************************************************
  181.  
  182. int trunc(int, long);
  183. Truncate an open'ed file
  184.  
  185. int ftrunc(FILE *, long);
  186. Truncate an fopen'ed file
  187.  
  188. int truncate(char *, long);
  189. Truncate a named file
  190.  
  191. **********************************************************
  192. *  Filename parsing functions                            *
  193. **********************************************************
  194.  
  195. int fnsplit(char *,char *,char *,char *,char *,char *,char *);
  196. Split a string into drive/path/file/ext
  197.  
  198. char * fnmerge(char *,char *,char *,char *,char *,char *,char *);
  199. Merge drive/path/file/ext into a file string
  200.  
  201. int has_wild(char *);
  202. Checks a string for DOS wildcards
  203.  
  204. int wildname(char *, char *, int);
  205. Matches filenames against a pattern
  206.  
  207. **********************************************************
  208. *  Normalize file names                                  *
  209. **********************************************************
  210.  
  211. int flnorm(char *, char *);
  212. Normalize a filename
  213.  
  214. char * fln_fix(char *);
  215. Remove "dot" directories from pathnames
  216.  
  217. char * unix2dos(char *);
  218. Converts Unix-style paths to DOS-style
  219.  
  220. **********************************************************
  221. *  Open files using a path specification                 *
  222. **********************************************************
  223.  
  224. FILE * fopenp(char *, char *);
  225. fopen a file in the PATH
  226.  
  227. FILE * fopeng(char *, char *, char *);
  228. fopend/fopenp combination
  229.  
  230. FILE * fopend(char *, char *, char *);
  231. Fopen a file in an environment variable
  232.  
  233. int openp(char *, int);
  234. Open a file in the PATH
  235.  
  236. int opend(char *, int, char *);
  237. Open a file in the PATH
  238.  
  239. int openg(char *, int, char *);
  240. opend/openp combination
  241.  
  242. int getpath(char *);
  243. Retrieve the PATH variable and parse
  244.  
  245. **********************************************************
  246. *  File extension functions                              *
  247. **********************************************************
  248.  
  249. void badext(char *);
  250. Report invalid filename extension and exit
  251.  
  252. void newext(char *, char *, char *);
  253. Change a filename extension
  254.  
  255. int exttyp(char *, char *);
  256. Check a filename for a particular extension
  257.  
  258. **********************************************************
  259. *  Miscellaneous functions                               *
  260. **********************************************************
  261.  
  262. void eraok(char *);
  263. Ask permission before overwriting existing file
  264.  
  265. void cant(char *);
  266. Report inability to open a file and exit
  267.  
  268. int repchar(char, int, FILE *);
  269. Repeat a character n times to fd
  270.  
  271. int iscons(FILE *);
  272. Is file descriptor the console
  273.  
  274.  
  275. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  276. *  MFLCONIO.H                                                          *
  277. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  278.  
  279.  
  280. **********************************************************
  281. *  Translate video attribute to ANSI.SYS command         *
  282. **********************************************************
  283.  
  284. char  *  make_ansi(int);
  285. Translate video attributes to ANSI strings
  286.  
  287. void     Bputs(char *);
  288. Write a string using BIOS only
  289.  
  290. **********************************************************
  291. *   Direct video package                                 *
  292. **********************************************************
  293.  
  294. void dvid_init(void);
  295. Initialize the direct video package
  296.  
  297. void dvid_bios(void);
  298. Use BIOS services rather than direct screen access
  299.  
  300. void dvid_sync(int);
  301. Avoid show on CGA monitors
  302.  
  303. void dvid_raw(int);
  304. Set control character translation mode
  305.  
  306. void dvid_done(void);
  307. Close the direct video package
  308.  
  309. void dvid_putchr(char);
  310. Place a character on the screen
  311.  
  312. void dvid_putstr(char *);
  313. Plase a string on the screen
  314.  
  315. void dvid_scroll(int, int, int, int, int, int);
  316. Scroll a region of the screen
  317.  
  318. void dvid_move(int, int);
  319. Move the direct video internal cursor
  320.  
  321. void dvid_setcount(int);
  322. Set repeat count for dvid_putchr()
  323.  
  324. void dvid_flush(void);
  325. Update the screen, merge the internal and PC cursors
  326.  
  327. void dvid_e2eol(void);
  328. Erase screen to end of line
  329.  
  330. void dvid_e2eos(void);
  331. Erase screen to end of screen
  332.  
  333. void dvid_attrib(int);
  334. Set direct video attribute (color)
  335.  
  336. void dvid_setpage(int, int);
  337. Set direct video page
  338.  
  339. void dvid_chgattrib(int, int, int, int, int);
  340. Change the attribute (color) for a region of the screen
  341.  
  342. void dvid_cls(void);
  343. Clear the display and home cursor
  344.  
  345. void dvid_clrfield(int, int, int);
  346. Clear a screen field
  347.  
  348. void dvid_say(int, int, char *);
  349. Display a string at specified position
  350.  
  351. void dvid_sayr(int, int, char *);
  352. Like dvid_say(), returns cursor to starting point
  353.  
  354. void dvid_enterfn(char *, int, int, int, int);
  355. Enter a filename from keyboard
  356.  
  357. void dvid_char_at(int, int, char);
  358. Display character at specified position
  359.  
  360. void dvid_char_atr(int, int, char);
  361. Like dvid_char_at(), returns cursor to start
  362.  
  363. void dvid_putsa(char *, int);
  364. Display a string with attribute
  365.  
  366. int dvid_printf(char *, ...);
  367. Write a formatted string to the screen
  368.  
  369. int dvid_printfa(int, char *, ...);
  370. Write a formatted string to the screen using specifed attrbiute
  371.  
  372. int dvid_getchr(int, int);
  373. Retrieve a character from the screen
  374.  
  375. int dvid_enterdata(char *, int, int, int, int);
  376. Enter a string of data from keyboard
  377.  
  378. int dvid_getattr(void);
  379. Gets the current screen attribute
  380.  
  381. int dvid_getraw(void)
  382. Gets the current control charatcer translation mode
  383.  
  384. **********************************************************
  385. *   Keyboard functions                                   *
  386. **********************************************************
  387.  
  388. void setcaps(void);
  389. Set the capslock status ON
  390.  
  391. void clrcaps(void);
  392. Sets Caps lock to OFF
  393.  
  394. void setnumlock(void);
  395. Sets numlock status ON
  396.  
  397. void clrnumlock(void);
  398. Sets numlock status OFF
  399.  
  400. int getkey(void);
  401. Extended keyboard fetch
  402.  
  403. int kbstatus(int);
  404. Returns specified keyboard status flag
  405.  
  406. int _kbstate(void);
  407. Returns keyboard status
  408.  
  409. **********************************************************
  410. *   Data entry functions functions                       *
  411. **********************************************************
  412.  
  413. void enterfn(char *, int, int, int, int);
  414. Enter a filename from keyboard
  415.  
  416. int enterdata(char *, int, int, int, int);
  417. Enter a string of data from keyboard
  418.  
  419. **********************************************************
  420. *   Console control and information functions            *
  421. **********************************************************
  422.  
  423. void viscroll(int, int, int, int, int, int, int);
  424. Scrolls the video display up or down
  425.  
  426. void vidpage(int);
  427. Set a video page as active page
  428.  
  429. void vid_border(int);
  430. Set border color
  431.  
  432. void vid_palette(int);
  433. Set color palette
  434.  
  435. void cursor_style(int, int, int);
  436. Alter the cursor style
  437.  
  438. void vmode(int);
  439. Set video mode
  440.  
  441. void v_init(void);
  442. Gets information on video system
  443.  
  444. int iscons(FILE *);
  445. Is file descriptor the console
  446.  
  447. int _stuff(void);
  448. Get equipment report (low level)
  449.  
  450. int stuff(int);
  451. Get equipment report (high level)
  452.  
  453. unsigned int getpos(int);
  454. Get current cursor position
  455.  
  456. **********************************************************
  457. *   Miscellaneous video functions                        *
  458. **********************************************************
  459.  
  460. void error(char *);
  461. Report a fatal error and exit
  462.  
  463. void cls(void);
  464. Clear screen and home cursor
  465.  
  466. void clrfield(int, int, int, int);
  467. Clear a screen field through BIOS
  468.  
  469. void d_cls(void);
  470. Clear current screen
  471.  
  472. void d_pos(int, int, int);
  473. Position the cursor on a video page
  474.  
  475. void d_say(int, int, char *);
  476. Display a string at a specific position
  477.  
  478. void d_saypag(int, int, char *, int);
  479. Display a string at a specific position with page specification
  480.  
  481. void mkbox(int, int, int, int, int);
  482. Make a box on the screen
  483.  
  484. void vid_wrpix(int, int, int);
  485. Write a pixel to the screen
  486.  
  487. int vid_rdpix(int, int);
  488. Read a pixel from the screen
  489.  
  490.  
  491. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  492. *  MFLOCALE.H                                                          *
  493. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  494.  
  495.  
  496. **********************************************************
  497. *  ANSI-compliant internationalization functions.        *
  498. **********************************************************
  499.  
  500. char *setlocale(int, const char *);
  501. Set a locale for a region
  502.  
  503. struct lconv localeconv(void);
  504. Retrieve the current active locale information
  505.  
  506.  
  507. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  508. *  MFLTIME.H                                                           *
  509. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  510.  
  511.  
  512. **********************************************************
  513. *  Microsecond accuracy timing operations.               *
  514. **********************************************************
  515.  
  516. uclock_t usec_difftime(start,finish)
  517. Calculate the difference between two times
  518.  
  519. uclock_t usec_clock(void);
  520. Read the system clock in microseconds
  521.  
  522. void restart_uclock(void);
  523. Re-initialize the microsecond clock
  524.  
  525. uclock_t usec_delay(uclock_t);
  526. Delay a given number of microseconds
  527.  
  528. LOGICAL usec_timeout(uclock_t, uclock_t, uclock_t);
  529. Test for a timeout condition
  530.  
  531. void msec_pause(long);
  532. Delay a given number of milliseconds
  533.  
  534. **********************************************************
  535. *  ANSI function to convert time to a string             *
  536. **********************************************************
  537.  
  538. size_t strftime(char *, size_t, const char *, const struct tm *);
  539. Convert data in tm structure to a string
  540.  
  541. **********************************************************
  542. *  Julian (scalar) date functions                        *
  543. **********************************************************
  544.  
  545. long ymd_to_julian (unsigned, unsigned, unsigned);
  546. Convert year, month, date to Julian date
  547.  
  548. void julian_to_ymd (long, unsigned *, unsigned *, unsigned *);
  549. Convert Julian date to year, month, date
  550.  
  551. int julian_to_wkday(long);
  552. Convert Julian date to day of the week
  553.  
  554. char * julian_to_dayname(long);
  555. Convert Julian date to day of the week
  556.  
  557. unsigned julian_to_yrday(long);
  558. Convert Julian date to day of the year
  559.  
  560. LOGICAL julian_to_time(long, time_t *);
  561. Convert Julian date to time_t value
  562.  
  563. LOGICAL julian_to_tm(long, struct tm *);
  564. Convert Julian date to tm structure
  565.  
  566. long time_to_julian(time_t);
  567. Convert time_t value to Julian date
  568.  
  569. long tm_to_julian(struct tm *);
  570. Convert tm structure to Julian date
  571.  
  572. **********************************************************
  573. *  Access file dates and time                            *
  574. **********************************************************
  575.  
  576. int getftime(int, struct ftime *);
  577. Get a file's time/date stamp
  578.  
  579. int setftime(int, struct ftime *);
  580. Set a file's time/date stamp
  581.  
  582. int touch(char *);
  583. Set file time/date stamp to the current time
  584.  
  585. void get_filetime(struct tm *, int);
  586. Get file date/time stamp
  587.  
  588. **********************************************************
  589. *  Misc time functions                                   *
  590. **********************************************************
  591.  
  592. void installtick(int *);
  593. Install timer interrupt service routine
  594.  
  595. void removetick(void);
  596. Remove timer interrupt service routine
  597.  
  598. void gtodsub(FILE *);
  599. Get time of day to file pointer
  600.  
  601. void gtodstr(char *);
  602. Get time of day to a string
  603.  
  604. int daynum(int, int, int);
  605. Find the number of a date within a year
  606.  
  607. int isleap(int);
  608. Check if year is a leap year
  609.  
  610. int weekday(int, int, int);
  611. Determine the day of the week form the date
  612.  
  613. char * monthis(int);
  614. Return a string pointer to name of month
  615.  
  616. char * wkdayname(int);
  617. Returns name of the day of the week
  618.  
  619.  
  620. *=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  621. * MFLSYS.H                                                              *
  622. *=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  623.  
  624.  
  625. **********************************************************
  626. *  Encryption/decryption                                 *
  627. **********************************************************
  628.  
  629. void crypt(char *);
  630. Encrypt/decrypt buffer data
  631.  
  632. LOGICAL cryptqual(char *, int);
  633. Qualify an encryption key
  634.  
  635. **********************************************************
  636. *  Serial communications functions                       *
  637. **********************************************************
  638.  
  639. void setport(int, int);
  640. Set port configuration
  641.  
  642. void setdtr(int, int);
  643. Set state of data terminal ready flag
  644.  
  645. void setrts(int, int);
  646. Set state of ready to send flag
  647.  
  648. void writechar(int, int);
  649. Send a char to the serial port
  650.  
  651. int readchar(int);
  652. Read a character from serial port
  653.  
  654. int ready_recv(int);
  655. Check for character availability
  656.  
  657. int ready_xmt(int);
  658. Check if port can accept a char to send
  659.  
  660. int chkdsr(int);
  661. Check state of data set ready flag
  662.  
  663. int chkdcd(int);
  664. Check state of carrier detect flag
  665.  
  666. int chkcts(int);
  667. Check state of clear to send flag
  668.  
  669. int chkring(int);
  670. Check state of ring indicator flag
  671.  
  672. int config_port(unsigned, int, int, int, int);
  673.  
  674. **********************************************************
  675. *  Printer functions                                     *
  676. **********************************************************
  677.  
  678. void pr_putline(char *);
  679. Print a string, and a cr/lf to the printer
  680.  
  681. void pr_puts(char *);
  682. Print a string to the printer
  683.  
  684. void pr_set(int);
  685. Set the number of the current printer
  686.  
  687. void pr_nl(void);
  688. Print a carriage return/line feed to printer
  689.  
  690. void pr_eject(void);
  691. Send a formfeed to the printer
  692.  
  693. void pr_carret(void);
  694. Send a carriage return to the printer
  695.  
  696. int blpr(char, int);
  697. Write a character to LPT? through BIOS 17H
  698.  
  699. int blprstat(int);
  700. Get LPT? status through BIOS 17H
  701.  
  702. int pr_putc(char);
  703. Send a character to the printer
  704.  
  705. **********************************************************
  706. *  Gameport functions                                    *
  707. **********************************************************
  708.  
  709. void init_game(unsigned char);
  710. Initialize and set game port mode
  711.  
  712. void clear_game(void);
  713. Clear pending input from game port
  714.  
  715. void debounce(void);
  716. Input debouncer
  717.  
  718. unsigned char get_press(void);
  719. Returns fully debounced key value
  720.  
  721. **********************************************************
  722. *  Error handling functions                              *
  723. **********************************************************
  724.  
  725. void aabort(int);
  726. Terminate a program using a common exit
  727.  
  728. void error(char *);
  729. Report a fatal error and exit
  730.  
  731. int ctlbrk();
  732. Control-break (^C) interrupt handler
  733.  
  734. **********************************************************
  735. *  Miscellaneous system functions                        *
  736. **********************************************************
  737.  
  738. void get_code_adr(unsigned int *, unsigned int *, unsigned int *);
  739. Get a function address
  740.  
  741. void get_data_adr(unsigned int *, unsigned int *, unsigned int *);
  742. Get a data item address
  743.  
  744. int _getdi(int);
  745. Get device information for file handle
  746.  
  747. int ibmtype(void);
  748. Find out type of computer
  749.  
  750. LOGICAL ansisys(void);
  751. Reports the availability of ANSI.SYS
  752.  
  753. void exit2dos(void);
  754. Permission to exit program
  755.  
  756. void shell2dos(char *);
  757. Temporary shell to DOS
  758.  
  759.  
  760. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  761. *  MFLSTRNG.H                                                          *
  762. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  763.  
  764.  
  765. char LAST_CHAR(char *);
  766. Returns last string character
  767.  
  768. char NEXT_TO_LAST_CHAR(char *);
  769. Returns penultimate string character
  770.  
  771. char STRING_TERMINATOR(char *);
  772. Returns terminating '\0'
  773.  
  774. LOGICAL STREQ(char *, char *);
  775. Compares strings TRUE/FALSE
  776.  
  777. LOGICAL STREQI(char *, char *);
  778. Compares strings TRUE/FALSE, UC/LC
  779.  
  780. int index(char *, char);
  781. Offset of leftmost char in a string
  782.  
  783. int rindex(char *, char);
  784. Offset of rightmost char in a string
  785.  
  786. **********************************************************
  787. *  BASIC-like string functions                           *
  788. **********************************************************
  789.  
  790. char * stralloc(int);
  791. Allocate a string from a string pool
  792.  
  793. char * left(char *, int);
  794. Return leftmost characters
  795.  
  796. char * right(char *, int);
  797. Return rightmost characters
  798.  
  799. char * mid(char *, int, int);
  800. Return embedded substring
  801.  
  802. char * string_add(char *, ...);
  803. BASIC-style string concatenation
  804.  
  805. int str_init(int, int);
  806. Initialize a string pool
  807.  
  808. void str_free(void);
  809. Free's the string pool
  810.  
  811. **********************************************************
  812. *  String translation functions                          *
  813. **********************************************************
  814.  
  815. int strxlat(char *, char *, char *);
  816. Translates characters based on tables
  817.  
  818. int strixlat(char *, char *, char *);
  819. Translates characters based on tables UC/LC
  820.  
  821. int strnxlat(char *, char *, char *, int);
  822. Translates first N characters based on tables
  823.  
  824. int strnixlat(char *, char *, char *, int);
  825. Translates first N characters based on tables UC/LC
  826.  
  827. **********************************************************
  828. *  Functions to remove unwanted characters               *
  829. **********************************************************
  830.  
  831. void strip(char *);
  832. Removes trailing newlines
  833.  
  834. void lv1ws(char *);
  835. Converts all multiple whitespace to single spaces
  836.  
  837. char * rmlead(char *);
  838. Removes leading whitespace
  839.  
  840. char * rmtrail(char *);
  841. Removes trailing whitespace
  842.  
  843. char * rmallws(char *);
  844. Removes all whitespace
  845.  
  846. **********************************************************
  847. *  Miscellaneous string functions                        *
  848. **********************************************************
  849.  
  850. void fillch(char *, char, int);
  851. Fill a string with a character
  852.  
  853. void loadstr(char *, char *, int);
  854. Load a string with padding
  855.  
  856. int argval(char *, int *, int);
  857. Convert an ASCII numerical string from an argument
  858.  
  859. int center(char *, int);
  860. Center a string
  861.  
  862. int dstr_i(char *, int*);
  863. Make an ASCII decimal string into an integer
  864.  
  865. int i_dstr(char *, int);
  866. Make an integer from a decimal ASCII string
  867.  
  868. unsigned int hstr_i(char *);
  869. Make an ASCII hexadecimal string into an integer
  870.  
  871.  
  872. *=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  873. * MFLMATH.H                                                             *
  874. *=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  875.  
  876.  
  877. **********************************************************
  878. *  CRC calculation functions                             *
  879. **********************************************************
  880.  
  881. unsigned crc16_clear(void);
  882. Clear a 16-bit crc value
  883.  
  884. unsigned crc16_update(unsigned, unsigned char);
  885. Update a 16-bit crc value
  886.  
  887. unsigned crc16_finish(unsigned);
  888. Finish a 16-bit crc calculation
  889.  
  890. unsigned long char crc32_clear(void);
  891. Clear a 32-bit crc value
  892.  
  893. unsigned long crc32_update(unsigned long, unsigned char);
  894. Update a 32-bit crc value
  895.  
  896. unsigned long crc32_finish(unsigned long);
  897. Finish a 32-bit crc calculation
  898.  
  899. **********************************************************
  900. *  Integer math functions                                *
  901. **********************************************************
  902.  
  903. int isqrt(unsigned);
  904. Extract integer square root of an int
  905.  
  906. int isqrtr(unsigned);
  907. Extract integer square root of an int w/ rounding
  908.  
  909. long lsqrt(unsigned long);
  910. Extract integer square root of a long
  911.  
  912. long lsqrtr(unsigned long);
  913. Extract integer square root of a long w/ rounding
  914.  
  915.  
  916. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  917. *  MFLDEFS.H                                                           *
  918. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  919.  
  920.  
  921. #define KB_flush()
  922. Empties keyboard buffer
  923.  
  924. #define Bputc(c)
  925. Write a character using BIOS only
  926.  
  927. #define BitSet(arg,posn)
  928. Set n'th bit
  929.  
  930. #define BitClr(arg,posn)
  931. Clear n'th bit
  932.  
  933. #define BitTst(arg,posn)
  934. Test n'th bit
  935.  
  936.  
  937. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  938. *  MFLSOUND.H                                                          *
  939. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
  940.  
  941.  
  942. void mktone(int, int, int);
  943. Make a tone to the speaker (with music capability)
  944.  
  945. void soundon(void);
  946. Turn on the speaker
  947.  
  948. void soundoff(void);
  949. Turn off the speaker
  950.  
  951.